package com.tmx.client;

import java.util.HashMap;
import tiled.gwt.TiledScreen;
import com.google.gwt.user.client.ui.Image;

public class MapRenderer implements TiledScreen{

	private Screen screen=null;
	
	public void setCurrentScreen(Screen screen){
		this.screen=screen;
	}
	
	public void loadImage(String source) {
		TMXImages.put(source, new Image(source));
	}

	private HashMap<String,Image> TMXImages = new HashMap<String, Image>();
	public int cameraX=0;
	public int cameraY=0;
	public float cameraAngle=0;

	public void putImage(String source, int sx, int sy, int sw, int sh, int dx,int dy, int dw, int dh) {
		Image img=TMXImages.get(source);
		if(img!=null){
			screen.putImage(img,sx,sy,sw,sh,cameraX+dx,cameraY+dy,dw,dh);
		}
		
	}

}
